יִגְמְלֵ֣נִי יְהוָ֣ה כְּצִדְקִ֑י כְּבֹ֥ר יָ֝דַ֗י יָשִׁ֥יב לִֽי׃
Ginantihan ako ng Walang-Hanggan ayon sa aking katuwiran; ayon sa kalinisan ng aking mga kamay ay ginantimpalaan Niya ako.
Rashi
according to my righteousness According to the righteousness of my following Him in the desert.
Rashi
according to the cleanness Heb. כבד, an expression of cleanness, as (below 24:4), “and pure of heart.” Another explanation: He sent forth from on high [and] He took me. [David] said this about himself, concerning the angel who came to the Rock of the Divisions (I Sam. 23:27) to turn Saul away from him, as it is stated: “And an angel came to Saul, etc.”
Rashi
according to my righteousness that I did not slay him when I sliced off the skirt of his coat. [Obviously, Rashi explains verses 8-17 as referring to Israel’s departure from Egypt. Only in verse 17 does he suggest the explanation that David refers to his own experiences.]